﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BLL
{
    public class Students
    {
        DAL.Students dalStudent = new DAL.Students();

        #region 执行软删除
        /// <summary>
        /// 执行软删除
        /// </summary>
        /// <param name="id">要删除的ID</param>
        /// <returns></returns>
        public bool DelSoft(string id)
        {
            return dalStudent.DelSoft(id);
        }
        #endregion

        #region 登录
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="uName"></param>
        /// <param name="uPwd"></param>
        /// <returns></returns>
        public MODEL.Students Login(string uName, string uPwd)
        {
            return dalStudent.QuerySingleByCondition(uName, uPwd);
        } 
        #endregion

        #region 根据ID 返回 单个 学生实体对象
        /// <summary>
        /// 根据ID 返回 单个 学生实体对象
        /// </summary>
        /// <param name="uName"></param>
        /// <param name="uPwd"></param>
        /// <returns></returns>
        public MODEL.Students GetStudentById(string strID)
        {
            return dalStudent.GetStudentById(strID);
        }
        #endregion

        #region 获得所有学生列表+List<MODEL.Students> GetAllStudents()
        /// <summary>
        /// 获得所有学生列表
        /// </summary>
        /// <returns></returns>
        public List<MODEL.Students> GetAllStudents()
        {
            return dalStudent.
                QueryListByCondition(null);
        }
        #endregion

        #region 修改学员信息
        /// <summary>
        /// 修改学员信息
        /// </summary>
        /// <param name="model">学员实体</param>
        /// <returns></returns>
        public bool ModifyStudent(MODEL.Students model)
        {
            return dalStudent.ModifyStudent(model);
        }
        #endregion
    }
}
